Skip to content

feat(explorers): add support for environment in Sentry (AG-2031)#3943

Draft
sagely1 wants to merge 10 commits intoSage-Bionetworks:mainfrom
sagely1:sentry-environment
Draft

feat(explorers): add support for environment in Sentry (AG-2031)#3943
sagely1 wants to merge 10 commits intoSage-Bionetworks:mainfrom
sagely1:sentry-environment

Conversation

@sagely1
Copy link
Contributor

@sagely1 sagely1 commented Mar 18, 2026

Description

This PR removes hardcoded Sentry DSNs and moved them to runtime config (config.json.template via ${SENTRY_DSN}). The initial effort gathered valuable information about environments currently used in production. Going forward, the hostname to environment mapping can be removed in favor of being integrated into the deployment pipeline.

Related Issue

AG-2031

Changelog

  • Removed client-side hostname-to-environment mapping. Sentry environment is now injected at runtime via ${SENTRY_ENVIRONMENT} instead of being derived from window.location.hostname
  • Simplified initSentry method - the interface now accepts dsn, environment, and release
  • Added create-config-json Nx target and tools/create-config-json.js script to generate config.json from templates with ${VAR:-default} syntax, replacing the committed config.json files (now gitignored)
  • Added a warning if SENTRY_DSN is not configured but is not required for the application to run

.openchallenges.toml

# Generated app config files (from templates via envsubst)
**/config/config.json
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding config.json to .gitignore to follow best practices

Comment on lines +17 to +23
"create-config-json": {
"executor": "nx:run-commands",
"options": {
"command": "node ../../../tools/create-config-json.js",
"cwd": "{projectRoot}"
}
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds support to generate a config.json with nx run agora-app:create-config-json now that config.json is being gitignored.

@sagely1 sagely1 changed the title feat(model-ad): add support for environment in Sentry () feat(model-ad): add support for environment in Sentry (AG-2031) Mar 18, 2026
@sagely1 sagely1 changed the title feat(model-ad): add support for environment in Sentry (AG-2031) feat(explorers): add support for environment in Sentry (AG-2031) Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant